<?php

require_once dirname(__FILE__).'/../lib/userGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/userGeneratorHelper.class.php';

/**
 * user actions.
 *
 * @package    mysmartmanager
 * @subpackage user
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class userActions extends autoUserActions
{
  public function executeBatchExtend(sfWebRequest $request)
  {
    $ids = $request->getParameter('ids');
    $q = Doctrine_Query::create()
    ->from('User u')
    ->whereIn('u.id', $ids);
    foreach ($q->execute() as $user)
    {
      $user->extend(true);
    }
    $this->getUser()->setFlash('notice', 'The selected users have been extended successfully.');
    $this->redirect('@user');
  }
  public function executeListExtend(sfWebRequest $request)
  {
    $user = $this->getRoute()->getObject();
    $user->extend(true);
    $this->getUser()->setFlash('notice', 'The selected users have been extended successfully.');
    $this->redirect('@user');
  }
}
